#coding:utf-8
class AError(Exception): #自定义AError类，继承Exception
    print('异常')
try:
    raise AError('自定义异常！')
except AError as e:
    print(e)